home *** CD-ROM | disk | FTP | other *** search
Wrap
XSetup plugin | 2001-05-14 | 5.8 KB | 156 lines
"FILE"="Xteq Systems X-Setup Plugin 5.0" "TYPE"="6" "COUNT"="4" "UIPATH"="Appearance\Start Menu\Visible Items" "NAME"="Visible Items in Start->Find" "LANGUAGE"="VBScript" "VERSION"="2.18" "TEXT 1"="Files or Folders \ Computer" "TEXT 2"="People" "TEXT 3"="On The Internet" "TEXT 4"="Microsoft Find Extensions Powertoy" "DESCRIPTION 1"="This plug-in lets you control which options are shown on the Find menus on the Start Menu and in Windows Explorer. These icons are all part of Windows or Internet Explorer." "DESCRIPTION 2"="To show an option on the menu, enable it, otherwise disabling the option will hide it. Changes take effect immediately, and this will affect all users of this computer." "DESCRIPTION 3"="Note #1: If 'Files or Folders' is hidden, 'Computer' will also be hidden." "DESCRIPTION 4"="Note #2: 'People' requires Outlook Express to be installed, and 'On The Internet' requires Internet Explorer to be installed. 'Microsoft Find Extensions Powertoy' requires the Find Extensions Powertoy to be installed." "DESCRIPTION 5"="Note #3: Disabling all items will lead to an empty menu being displayed." "COMMENT 1"="I didn't *find* this plug-in very difficult to make :)" "AUTHOR"="Neil R. Turner (totalxs@hotmail.com) for Xteq Systems" "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved" "CONTACTURL"="http://www.neilrt.cwc.net/" ' Normally I'm a bit shy of comments but I thought I'd add some ' so that you people can see how this works. Cool, eh? :) ' ' Outlook Express folder (for the WAB icon) OE="HKLM\Software\Microsoft\Outlook Express\InstallRoot" ' ' Windows\System folder (for the WebSearch icon) w=GetWinSysDir ' ' Where all of the Find keys are installed: s1="HKLM\Software\Microsoft\Windows\CurrentVersion\explorer\FindExtensions" ' ' The Files/Folders entry: s2="\ShellFind" ' ' 'Static' entries - these are the extensions (People/Internet) s3="\Static\" ' ' The Powertoy CLSID FF="{61E218E0-65D3-101B-9F08-061CEAC3D50D}" 'Called when the Plugin is started SUB Plugin_Initialize ' Find out whether Files/Folders is enabled a=RegReadValue(s1 & s2 & "\@") if a=FF then Call SetUIElement(1,true) end if ' Find out whether People is enabled (or should that be "are"?) a=RegReadvalue(s1 & s3 & "WabFind\@") if IsEmpty(a)=false then Call SetUIElement(2,true) end if ' Ditto for On The Internet a=RegReadValue(s1 & s3 & "WebSearch\@") if IsEmpty(a)=false then Call SetUIElement(3,true) end if ' And finally, the Powertoy a=RegReadValue(s1 & "\{97E2C371-FDDD-11CF-807F-02608C8D98DF}\@") if IsEmpty(a)=false then Call SetUIElement(4,true) end if END SUB SUB Plugin_CheckData(ElementIndex) ' This is only here for X-Setup 5.7 compatibility - since we are only using ' checkboxes we don't need this. And besides, X-Setup 6.0 ignores it completely! END SUB 'Called when the Plugin should apply the changes SUB Plugin_Apply(ElementIndex,ElementSubIndex) ' Files/Folders. This is nice and easy, either the value is there, or it isn't. b=GetUIElement(1) if b=true then Call RegWriteValue(s1 & s2 & "\@","{61E218E0-65D3-101B-9F08-061CEAC3D50D}",1) else Call RegDeletePath(s1 & s2) end if ' This is more difficult.... b=GetUIElement(2) if b=true then ' user wants this enabled.... ' Add GUID: Call RegWriteValue(s1 & s3 & "WabFind\@","{32714800-2E5F-11d0-8B85-00AA0044F941}",1) ' Add name as it should appear on Find menu: Call RegWriteValue(s1 & s3 & "WabFind\0\@","&People...",1) ' Give it a nice icon (this is where we use the OE variable) o=RegReadValue(OE) Call RegWriteValue(s1 & s3 & "WabFind\0\DefaultIcon\@", o & "\wabfind.dll, 0",1) ' Done! else ' User wants this disabled.... ' See if it was previously enabled: f=RegPathExists(s1 & s3 & "WabFind") if f=true then ' Get rid of Icon and its path ' (NB: This will crash if there are extra values here, but this isn't likely) Call RegDeleteValue(s1 & s3 & "WabFind\0\DefaultIcon\@") Call RegDeletePath(s1 & s3 & "WabFind\0\DefaultIcon") ' Now we need to check if there is a 'helptext' entry (Windows 2000... I think) ' If it exists, we need to get rid of it (it shouldn't exist, but yah never know :) g=RegPathExists(s1 & s3 & "WabFind\0\HelpText") if g=true then Call RegDeletePath(s1 & s3 & "WabFind\0\HelpText") end if ' Finally, we can delete the remaining keys... Call RegDeletePath(s1 & s3 & "WabFind\0") Call RegDeletePath(s1 & s3 & "WabFind") ' as Pierre would say, "Voilα" end if end if ' This follows precisely the same pattern as above, so there's no point in repeating the comments :) b=GetUIElement(3) if b=true then Call RegWriteValue(s1 & s3 & "WebSearch\@","{07798131-AF23-11d1-9111-00A0C98BA67D}",1) Call RegWriteValue(s1 & s3 & "WebSearch\0\@","On the &Internet...",1) Call RegWriteValue(s1 & s3 & "WebSearch\0\DefaultIcon\@", w &"shdocvw.dll,-111",1) else f=RegPathExists(s1 & s3 & "WebSearch") if f=true then Call RegDeleteValue(s1 & s3 & "WebSearch\0\DefaultIcon\@") Call RegDeletePath(s1 & s3 & "WebSearch\0\DefaultIcon") g=RegPathExists(s1 & s3 & "WebSearch\0\HelpText") if g=true then Call RegDeletePath(s1 & s3 & "WebSearch\0\HelpText") end if Call RegDeletePath(s1 & s3 & "WebSearch\0") Call RegDeletePath(s1 & s3 & "WebSearch") end if end if ' This follows the same method as the first example, so no point in copying it. b=GetUIElement(4) if b=true then Call RegWriteValue(s1 & "\{97E2C371-FDDD-11CF-807F-02608C8D98DF}\@","Find... Extensions",1) else f=RegPathExists(s1 & "\{97E2C371-FDDD-11CF-807F-02608C8D98DF}") if f=true then Call RegDeletePath(s1 & "\{97E2C371-FDDD-11CF-807F-02608C8D98DF}") end if end if END SUB SUB Plugin_Terminate ' Nothing in here, but it's still needed by X-Setup :( END SUB